﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="register.aspx.cs" Inherits="register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 100%; font-family: Arial;">
        <p>
            &nbsp;
        </p>
        <p style="margin-left: 40px">
            Register Yourself with us.......
        </p>
        <p>
            &nbsp;
        </p>
        <p style="margin-left: 40px">
            First Name
            <br />
            <asp:TextBox ID="txtfirstname" runat="server" CausesValidation="True" Width="300px" Height="20px" ToolTip="Should Not Contain Any Number, Special Characters or Space."></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtfirstname" ErrorMessage="Required field should not be left blank." Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator runat="server" ControlToValidate="txtfirstname" ErrorMessage="First name should not contain numbers or symbols or space." ValidationExpression="[a-zA-Z]+" Display="Dynamic"></asp:RegularExpressionValidator>

        </p>
        <p style="margin-left: 40px">
            Last Name
            <br />
            <asp:TextBox ID="txtlastname" runat="server" CausesValidation="True" Width="300px" Height="20px" ToolTip="Should Not Contain Any Number, Special Characters or Space."></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtlastname" ErrorMessage="Required field should not be left blank." Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtlastname" ValidationExpression="[a-zA-Z]+" ErrorMessage="Last name should not contain numbers or symbols." Display="Dynamic"></asp:RegularExpressionValidator>
        </p>

        <p style="margin-left: 40px">
            User Name
            <br />
            <asp:TextBox ID="txtusername" runat="server" CausesValidation="True" Width="300px" Height="20px" ToolTip="Should Not Contain Any Special Characters or Space."></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtusername" ErrorMessage="Required field should not be left blank." Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtusername" ValidationExpression="[a-zA-Z]\w{4,15}" ErrorMessage="Username is not valid." Display="Dynamic"></asp:RegularExpressionValidator>
            <asp:CustomValidator ID="userValidator" ErrorMessage="User with same User Name already exist." runat="server" OnServerValidate="user_ServerValidate" ValidateEmptyText="True" Display="Dynamic" />
        </p>

        <p style="margin-left: 40px">
            Password
            <br />
            <asp:TextBox ID="txtpassword" runat="server" TextMode="Password" CausesValidation="True" Width="300px" Height="20px" ToolTip="Should Contain Atleast 1 digit & 1 alphabet. Must be between 6-15 characters"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtpassword" ErrorMessage="Password cannot be left blank" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtpassword" ValidationExpression="^(?=.*[0-9])(?=.*[a-zA-Z]).{6,15}$" ErrorMessage="Password is in incorrect form." Display="Dynamic"></asp:RegularExpressionValidator>
        </p>

        <p style="margin-left: 40px">
            Confirm Password
            <br />
            <asp:TextBox ID="txtconfirmpassword" runat="server" TextMode="Password" CausesValidation="True" Width="300px" Height="20px"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtpassword" ErrorMessage="Password cannot be left blank." Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:CompareValidator runat="server" ControlToCompare="txtpassword" ControlToValidate="txtconfirmpassword" ErrorMessage="Passwords do not match." Display="Dynamic"></asp:CompareValidator>
        </p>

        <p style="margin-left: 40px">
            E-mail 
            <br />
            <asp:TextBox ID="txtEmail" runat="server" CausesValidation="True" Width="300px" Height="20px"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtemail" ErrorMessage="Required field should not be left blank." Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtemail" ValidationExpression="[a-zA-Z][a-zA-Z0-9_.]+@[a-zA-Z0-9]+\.[a-zA-Z]+" ErrorMessage="Enter E-mail in correct format." Display="Dynamic"></asp:RegularExpressionValidator>
            <asp:CustomValidator ID="emailValidator" ErrorMessage="User with same E-Mail already exist." runat="server" OnServerValidate="email_ServerValidate" ValidateEmptyText="True" Display="Dynamic" />
        </p>

        <p>
            &nbsp;
        </p>
        <p style="margin-left: 40px">
            <asp:CheckBox ID="chkiagree" runat="server" CausesValidation="True" ClientIDMode="AutoID" />
            <strong>&nbsp;</strong>I agree to the terms and conditions.&nbsp;
            <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </strong>
            <asp:CustomValidator ID="vldIagree" ErrorMessage="Please check I agree." runat="server" OnServerValidate="chkiagree_ServerValidate" ValidateEmptyText="True" Display="Dynamic" />
        </p>
        <p style="margin-left: 40px">
            &nbsp;
        </p>
        <p style="margin-left: 40px">
            <asp:Label ID="lblText" runat="server" Text="Label"></asp:Label>
        </p>
        <p style="margin-left: 40px">
            &nbsp;
        </p>
        <p style="margin-left: 40px">
            <asp:Button ID="btnregister" runat="server" Text="Register" OnClick="btnregister_Click" />
        </p>
    </div>
</asp:Content>

